﻿using PersonBlog.BLL;
using PersonBlog.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PersonBlog.Controllers
{
    public class TaskManageController : Controller
    {
        TaskManageBLL taskBll = new TaskManageBLL();

        // GET: TaskManage
        public ActionResult Index()
        {
            TaskManageModel task = new TaskManageModel();
            return View(task);
        }

        public ActionResult Create(TaskManageModel task)
        {
            if (string.IsNullOrWhiteSpace(task.Name))
            {
                return RedirectToAction("Index", "TaskManage");
            }
            taskBll.Add(task);
            return RedirectToAction("Main", "Home");
        }
    }
}